home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextLibrary / Frameworks / Foundation.framework / Versions / B / Headers / NSBundle.h < prev    next >
Encoding:
Text File  |  1997-02-27  |  2.3 KB  |  80 lines

  1. /*    NSBundle.h
  2.     Dynamically loadable code with resources
  3.     Copyright 1994-1996, NeXT Software, Inc.  All rights reserved.
  4. */
  5.  
  6. #import <Foundation/NSObject.h>
  7.  
  8. @class NSArray, NSDictionary, NSString;
  9.  
  10. /* Because NSBundle caches allocated instances, subclasses should be prepared
  11.    to receive an already initialized object back from [super initWithPath:] */
  12. @interface NSBundle : NSObject {
  13. @private
  14.     struct {
  15.     unsigned int    _externRetain : 1;
  16.     unsigned int    _retainCount : 7;
  17.     unsigned int    _bundleType : 3;
  18.     unsigned int    _codeLoaded : 1;
  19.     unsigned int    _codeAttempted : 1;
  20.     unsigned int    _init : 1;
  21.     unsigned int    _reserved : 18;
  22.     }            _flags;
  23.     id            _infoDictionary;
  24.     void        *_classes;
  25.     Class        _principalClass;
  26.     void        *_tmp1;
  27.     void        *_tmp2;
  28.     void        *_reserved1;
  29.     void        *_reserved;
  30. }
  31.  
  32. + (NSBundle *)mainBundle;
  33. + (NSBundle *)bundleWithPath:(NSString *)path;
  34. - (id)initWithPath:(NSString *)path;
  35.  
  36. + (NSBundle *)bundleForClass:(Class)aClass;
  37.  
  38. #if !defined(STRICT_OPENSTEP) && !defined(STRICT_40)
  39. + (NSArray *)allBundles;
  40. + (NSArray *)allFrameworks;
  41. #endif
  42.  
  43. - (NSString *)bundlePath;
  44. - (NSString *)resourcePath;
  45.  
  46. - (Class)classNamed:(NSString *)className;
  47.  
  48. - (Class)principalClass;
  49.  
  50. #if !defined(STRICT_OPENSTEP) && !defined(STRICT_40)
  51. - (BOOL)load;
  52. #endif
  53.  
  54. + (NSString *)pathForResource:(NSString *)name ofType:(NSString *)ext inDirectory:(NSString *)path;
  55. - (NSString *)pathForResource:(NSString *)name ofType:(NSString *)ext;
  56. - (NSString *)pathForResource:(NSString *)name ofType:(NSString *)ext inDirectory:(NSString *)subpath;
  57.  
  58. - (NSArray *)pathsForResourcesOfType:(NSString *)ext inDirectory:(NSString *)subpath;
  59.  
  60. - (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)value table:(NSString *)tableName;
  61.  
  62. #if !defined(STRICT_OPENSTEP)
  63.  
  64. - (NSDictionary *)infoDictionary;
  65.  
  66. #endif /* !STRICT_OPENSTEP */
  67.  
  68. @end
  69.  
  70. #define NSLocalizedString(key, comment) \
  71.         [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
  72. #define NSLocalizedStringFromTable(key, tbl, comment) \
  73.         [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:(tbl)]
  74. #define NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) \
  75.         [bundle localizedStringForKey:(key) value:@"" table:(tbl)]
  76.  
  77. FOUNDATION_EXPORT NSString *NSBundleDidLoadNotification;
  78. FOUNDATION_EXPORT NSString *NSLoadedClasses;    // notification key
  79.  
  80.